<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">

    <title>weather</title>
    <meta content="" name="descriptison">
    <meta content="" name="keywords">

    <!-- Favicons -->
    <link href="static/assets/img/favicon.png" rel="icon">
    <link href="static/assets/img/apple-touch-icon.png" rel="apple-touch-icon">

    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,600,600i,700,700i,900"
          rel="stylesheet">

    <!-- Vendor CSS Files -->
    <link href="static/assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="static/assets/vendor/icofont/icofont.min.css" rel="stylesheet">
    <link href="static/assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
    <link href="static/assets/vendor/animate.css/animate.min.css" rel="stylesheet">
    <link href="static/assets/vendor/venobox/venobox.css" rel="stylesheet">
    <link href="static/assets/vendor/aos/aos.css" rel="stylesheet">
    <script async src="https://app2.weatherwidget.org/js/?id=ww_6904bb85da0c4"></script>

    <!-- Template Main CSS File -->
    <link href="static/assets/css/style.css" rel="stylesheet">
    <link href="static/assets/css/weather.css" rel="stylesheet">

</head>

<body>


<!-- ======= Header ======= -->
<header id="header">
    <div class="container">

        <div class="logo float-left">
            <h1 class="text-light"><a href="/index"><span>天气可视化系统的设计与实现</span></a></h1>
        </div>

        <nav class="nav-menu float-right d-none d-lg-block">
            <ul>
                <li><a href="/index">首页<i class="la la-angle-down"></i></a></li>

                <li class="drop-down"><a href="">可视化</a>
                    <ul>
                        <li><a href="/line">温度折线图</a></li>
                        <li><a href="/bar">天气柱状图</a></li>
                        <li><a href="/rose_pie">风力风向玫瑰图</a></li>
                        <li><a href="/pie">空气质量指数饼图</a></li>
                    </ul>
                </li>
                <li><a href="/data">数据展示</a></li>
                <li class="active"><a href="/weather">实时天气</a></li>
                <li><a href="/user_login">退出</a></li>
            </ul>
        </nav>

    </div>
</header><!-- End Header -->

<!-- ======= Counts Section ======= -->
<section class="counts section-bg">
    <div class="container" style="height: 495.5px">

        <div class="section-title">
            <h2>实时天气查询</h2>
            <p></p>
        </div>

        <form method="post">
            <label for="city">请输入城市:</label>
            <input type="text" id="city" name="city" required>
            <button type="submit">查询</button>
        </form>

        <div class="weather" id="ww_6904bb85da0c4" v='1.3' loc='id' style="margin-left: 100px;margin-top: 50px;"
             a='{"t":"horizontal","lang":"zh","sl_lpl":1,"ids":["wl383"],"font":"Arial","sl_ics":"one_a","sl_sot":"celsius","cl_bkg":"#FFFFFF00","cl_font":"#000000","cl_cloud":"#d4d4d4","cl_persp":"#2196F3","cl_sun":"#FFC107","cl_moon":"#FFC107","cl_thund":"#FF5722"}'>
            <a href="https://weatherwidget.org/" id="ww_6904bb85da0c4_u" target="_blank">Html weather widget</a>
        </div>

        <div class="weather">
            {% if weather_data %}
                <h5 style="margin-bottom: 16px;">
                    城市: {{ weather_data.city_idname[3] }} {{ weather_data.city_idname[2] }} {{ weather_data.city_idname[1] }}
                </h5>
                <p>当前天气: {{ weather_data.now.text }} {{ weather_data.now.temp }} °C</p>
                <p>体感温度: {{ weather_data.now.feelsLike }} °C</p>
                <p>空气质量指数: {{ weather_data.air.aqi }}</p>
                <p>降水情况: {{ weather_data.rain }}</p>
                <p>今日天气: {{ weather_data.daily[0].textDay }} {{ weather_data.daily[0].tempMin }}
                    - {{ weather_data.daily[0].tempMax }} °C</p>

                {% if weather_data.hourly | length > 1 %}
                    <p>1 小时后天气: {{ weather_data.hourly[1].text }} {{ weather_data.hourly[1].temp }} °C</p>
                {% else %}
                    <p class="error">没有小时级天气数据。</p>
                {% endif %}

                {% if weather_data.daily | length > 1 %}
                    <p>1 天后天气: {{ weather_data.daily[1].textDay }} {{ weather_data.daily[1].tempMin }}
                        - {{ weather_data.daily[1].tempMax }} °C</p>
                {% else %}
                    <p class="error">没有天级天气数据。</p>
                {% endif %}
            {% endif %}
        </div>

    </div>

</section>

<footer id="footer" style="position: fixed;">
    <div class="container">
        <div class="copyright">Copyright &copy; 2021.数据科学与大数据技术.<a target="_blank" href="#">天气可视化系统</a>
        </div>
        <div class="credits"></div>
    </div>
</footer>

<a href="#" class="back-to-top"><i class="icofont-simple-up"></i></a>

<!-- Vendor JS Files -->
<script src="static/assets/vendor/jquery/jquery.min.js"></script>
<script src="static/assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="static/assets/vendor/jquery.easing/jquery.easing.min.js"></script>
<script src="static/assets/vendor/jquery-sticky/jquery.sticky.js"></script>
<script src="static/assets/vendor/venobox/venobox.min.js"></script>
<script src="static/assets/vendor/waypoints/jquery.waypoints.min.js"></script>
<script src="static/assets/vendor/counterup/counterup.min.js"></script>
<script src="static/assets/vendor/isotope-layout/isotope.pkgd.min.js"></script>
<script src="static/assets/vendor/aos/aos.js"></script>


<!-- Template Main JS File -->
<script src="static/assets/js/main.js"></script>

</body>

</html>